package com.xxtx.trade.sysUser.mapper;


import com.xxtx.trade.sysUser.bean.SysUserPhone;
import com.xxtx.trade.sysUser.dto.SysUserPhoneDto;
import com.xxtx.trade.sysUser.vo.SysUserPhoneVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface SysUserPhoneMapper {
    int deleteByPrimaryKey(String id);

    int insert(SysUserPhone record);

    int insertSelective(SysUserPhone record);

    SysUserPhoneMapper selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(SysUserPhone record);

    int updateByPrimaryKey(SysUserPhone record);

    /**
     *  查询绑定手机号
     * @param sysUserPhone
     * @return
     */
    SysUserPhoneVo selectByIccid(SysUserPhoneDto sysUserPhone);

    /**
     * 查询手机号是否存在
     */
    Integer selectUserByPhone(String userPhone);

    /**
     * 查询iccid是否已经绑定
     */
    Integer selectUserByIccid(String iccid);
    /**
     * 查看手机绑定列表
     * @param sysUserPhoneDto
     * @return
     */
    List<SysUserPhoneVo> selectBindList(SysUserPhoneDto sysUserPhoneDto);

    void updateBindPhone(SysUserPhoneDto phone);

    String selectSimInfoByIccid(String iccid);

    /**
     * 查看默认绑定的手机号
     * @param dto
     * @return
     */
    List<String> selectByDefaultSimByPhone(SysUserPhoneDto dto);

    int updateByDefaultSimByPhone(SysUserPhoneDto dto);

    int updatesimDefault(SysUserPhoneDto dto);

    void deleteByIccid(String iccid);

    List<SysUserPhone> selectQueryList(SysUserPhoneDto dto);

    String selectSimInfoByIccidAndHangYang(String iccid);
    /**将删除的卡数据添加到新的表*/
    int insertDelete(SysUserPhoneDto dto);

    /**
     * 根据查询条件
     * @param params
     * @return
     */
    Map<String, String> selectAccountBy(Map<String, String> params);

    /**
     * 开户，并且设置支付密码
     * @param params
     * @return
     */
    int insertUserAccount(Map<String, Object> params);

    /**
     * 查询是否开户
     * @param mobile
     * @return
     */
    Integer selectAccountByMobile(@Param("mobile") String mobile);

    /**
     * 设置支付密码
     * @param params
     * @return
     */
    int setPayPass(Map<String, Object> params);

    /**
     * 根据ICCID查询手机号
     * @param iccid
     * @return
     */
    Map<String,Object> selectMobileByIccid(@Param("iccid") String iccid);


    List<String> selectIsCollectAGentId();


    List<String> selectAllsCollectAGentId(List<String> list);
    int selectSimAuthOrder(String iccid);

    List<Map<String, Object>> selectorderList(SysUserPhoneDto dto);

    int selectEnableBindPhone();


    String selecticcidByIntoNo(String iccid);

}